﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ShopManagement.Dao;
using ShopManagement.Common;
using ShopManagement.Forms;

namespace ShopManagement
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                SmDao myDao = new SmDao(Utility.GenerateAccessConnectionString(Constants.PassWord));
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new LoginForm(myDao));
                myDao.CloseConnection();
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message, Constants.Messages.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
